package com.jshan.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jshan.base.entity.SysUser;
import com.jshan.base.vo.Result;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

public interface SysUserService extends IService<SysUser> {
    Result login(SysUser loginUser);

    Result getUserInfo();

    List<SysUser> listAll();

    IPage<SysUser> getUserPage(IPage<SysUser> page);

    boolean saveUser(SysUser user);

    boolean updateUser(SysUser user);

    boolean deleteUser(Long id);

    // 更新个人信息
    boolean updateProfile(SysUser user);

    // 修改密码
    boolean updatePassword(Long userId, String oldPassword, String newPassword);

    // 上传头像
    String uploadAvatar(Long userId, MultipartFile file);

    // 根据部门ID分页查询用户列表
    IPage<SysUser> getUsersByDeptId(IPage<SysUser> page, Long deptId, String username, String phone, Integer status);
}
